From 7a67808ae79beb6460c763b3be695e9cc957c7af Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 5 Nov 2014 15:06:06 -0800 Subject: [PATCH] Fix some more flaky tests At the same time, also improve the deprecation message for the old build command to be a little more descriptive about how to migrate --- src/cargo/util/toml.rs | 7 ++++++- tests/test_cargo_compile_custom_build.rs | 2 +- tests/test_cargo_compile_old_custom_build.rs | 15 ++++++++++----- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/cargo/util/toml.rs b/src/cargo/util/toml.rs index f2abb2dd1..ead2c4f59 100644 --- a/src/cargo/util/toml.rs +++ b/src/cargo/util/toml.rs @@ -531,7 +531,12 @@ impl TomlManifest { deprecated in favor of [lib]")); } if has_old_build { - manifest.add_warning(format!("warning: the old build command has been deprecated")); + manifest.add_warning(format!("warning: an arbitrary build command \ + has now been deprecated.")); + manifest.add_warning(format!(" It has been replaced by custom \ + build scripts.")); + manifest.add_warning(format!(" For more information, see \ + http://doc.crates.io/build-script.html")); } Ok((manifest, nested_paths)) } diff --git a/tests/test_cargo_compile_custom_build.rs b/tests/test_cargo_compile_custom_build.rs index 4fa32fa63..52211edd3 100644 --- a/tests/test_cargo_compile_custom_build.rs +++ b/tests/test_cargo_compile_custom_build.rs @@ -455,7 +455,7 @@ test!(testing_and_such { {compiling} foo v0.5.0 (file://[..]) {running} `[..]build-script-build[..]` {running} `rustc [..] --crate-name foo [..]` -{running} `rustc [..] --test [..]` +{running} `rustc [..] --crate-name foo [..]` {running} `[..]foo-[..]` running 0 tests diff --git a/tests/test_cargo_compile_old_custom_build.rs b/tests/test_cargo_compile_old_custom_build.rs index 63a8081f2..2e348db69 100644 --- a/tests/test_cargo_compile_old_custom_build.rs +++ b/tests/test_cargo_compile_old_custom_build.rs @@ -44,7 +44,9 @@ test!(old_custom_build { execs().with_status(0) .with_stdout(format!(" Compiling foo v0.5.0 ({})\n", p.url())) - .with_stderr("warning: the old build command has been deprecated")); + .with_stderr("warning: [..] deprecated.\n\ + [..]\n\ + [..]")); }) test!(old_custom_multiple_build { @@ -107,8 +109,7 @@ test!(old_custom_multiple_build { assert_that(p.cargo_process("build"), execs().with_status(0) .with_stdout(format!(" Compiling foo v0.5.0 ({})\n", - p.url())) - .with_stderr("warning: the old build command has been deprecated")); + p.url()))); }) test!(old_custom_build_failure { @@ -148,7 +149,9 @@ test!(old_custom_build_failure { "#); assert_that(p.cargo_process("build"), execs().with_status(101).with_stderr(format!("\ -warning: the old build command has been deprecated\n\ +warning: an arbitrary build command has now been deprecated. + [..] + [..] Failed to run custom build command for `foo v0.5.0 ({dir})` Process didn't exit successfully: `{}` (status=101)\n\ --- stderr\n\ @@ -212,7 +215,9 @@ test!(old_custom_second_build_failure { "#); assert_that(p.cargo_process("build"), execs().with_status(101).with_stderr(format!("\ -warning: the old build command has been deprecated\n\ +warning: an arbitrary build command has now been deprecated. + [..] + [..] Failed to run custom build command for `foo v0.5.0 ({dir})` Process didn't exit successfully: `{}` (status=101)\n\ --- stderr\n\ -- 2.30.2